package com.thrd.taiexhibition.model;

import com.alibaba.fastjson.JSON;
import com.thrd.basicframework.http.OkHttpUtils;
import com.thrd.basicframework.http.callback.ThrdCallBack;
import com.thrd.taiexhibition.bean.BeanCityIndustryDetailCompanyData;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.utils.Constant;

/**
 * 查询重点产业详情公司关联信息
 * @author: ${唐杰}
 * @date: 2021/3/29
 */
public class CityIndustryDetailCompanyModel {

    public static final String TAG="CityIndustryDetailCompanyModel";

    /**
     * 获取重点产业详情公司关联信息
     */
    public void getCityIndustryDetailCompanyModel(long id,final MvpCallback<BeanCityIndustryDetailCompanyData> mvpCallback){
        OkHttpUtils.get().url(Constant.HTTP_CITY_FOCUS_COMPANY_INFO)
                .tag(TAG)
                .addParams("industryDetailId",String.valueOf(id))
                .build().execute(new ThrdCallBack<BeanCityIndustryDetailCompanyData>() {
            @Override
            public void onFailed(String e, int code) {
                mvpCallback.onFailed(e,code);
            }

            @Override
            public void onResponse(BeanCityIndustryDetailCompanyData response, int id) {
                mvpCallback.onSuccess(response);
            }

            @Override
            public BeanCityIndustryDetailCompanyData onJson(String s) {
                BeanCityIndustryDetailCompanyData beanCityIndustryList= JSON.parseObject(s, BeanCityIndustryDetailCompanyData.class);
                return beanCityIndustryList;
            }


        });


    }
}
